Rapidly calculating the partition function of macroscopic systems
Li Jing-Tian1, Ning Bo-Yuan2, Gong Le-Cheng1, Zhuang Jun2, Ning Xi-Jing1, †
Institute of Modern Physics, Department of Nuclear Science and Technology, Fudan University, Shanghai 200433, China
Department of Optical Science and Engineering, Fudan University, Shanghai 200433, China

 

† Corresponding author. E-mail: xjning@fudan.edu.cn

Abstract

It has remained an open problem to accurately compute the partition function of macroscopic systems since the establishment of statistical physics. A rapid method approaching this problem was presented and was strictly tested by molecular dynamic (MD) simulations on Ar atoms in both dense gaseous and liquid states. The outcomes from the method on the internal energy and the work of isothermal expansion (and therefore the free energy) are in good agreement with the MD simulations, suggesting the method would be immediately applied in vast areas.

1. Introduction

About one hundred years ago, it became possible to predict the thermal dynamical properties and phase transform conditions of realistic systems in gaseous, liquid, or solid states due to the birth of statistical physics. Up to the present, however, the predication is very limited because it is difficult to accurately compute the partition functions (PFs) of systems composed of more than several hundreds atoms. Since the PF can directly produce the state equation, the internal energy, the entropy, and the free energy, which represents the driving force of a system in nonequilibrium evolutions, precise calculations of the PF are highly desired today in nanoclusters synthesis,[1,2] predicting protein folding,[35] materials’ phase transformation,[6] and designing new functional materials as crystal[7,8] or bulk metal glass.[9]

The attempts to exactly compute PFs and free energy have been continued in the past half a century. In 1950s, Zwanzig et al. put forward the earliest approach to calculate the free energy,[10,11] which is able to obtain the free energy difference between two states. Nevertheless, the method is largely limited by the low accuracy and can only be cautiously applied in cases where disparity between the two states is small.[12] Several methods were later developed by calculating the density of states, eg., histogram reweighting,[13] and transition matrix.[14] Among them, Wang–Landau (W–L) sampling formalism[15] proved to be the most effective for its successful applications to small systems such as the Ising model[15] and lattice protein model.[16] However, the computational efficiency and accuracy deeply rely on the convergence criterion and the modification factor.[1720] In 2011, Hainam Do et al.[21] greatly improved the W–L method and proposed a more efficient method, which on the same accuracy level, takes into account the amount of configurations about 2–3 orders less than the original W–L method.

In spite of the fact that considerable progress has been made in PF computations, it goes far beyond the current computer capacity to deal with macroscopic systems.[20,2224] The W–L method, for example, has to consider configurations even only concerning 64 water molecules.[21] In fact, the upper limit treated by the W–L method has always been less than 300 particles and it could be hardly possible to extend the previous methods to larger systems. Though Hainam Do et al. improved the efficiency, there is still a huge amount of calculation when the system becomes larger. Furthermore, the accuracy of the previous methods is also a problem. Usually, it was tested by comparisons with experimental measurements of magnetization,[15] specific heat capacity,[17] or pressure.[6] However, the theoretical results depend greatly on some artificial parameters in the empirical potential (EP), so even if the theoretical and experimental results are in good agreement, it cannot yet be affirmed that the method for calculating the PF is accurate because the EP may not be correct to describe the realistic systems. For example, two EPs were employed to calculate the pressure of a carbon dioxide system in a two-phase equilibrium state by the same method[6] and produced significantly different results, one of which deviates obviously from the experimental measurements. Clearly, the deviation cannot deny the theoretical method for calculating the pressure. Relatively, molecular dynamics (MD) simulation[2529] should be a more reasonable way to examine the methods because the MD and the PF computation share the same EP. Actually, we have performed MD simulations of gaseous Lennard–Jones (L–J) atoms to obtain the internal energy and the isothermal expansion work, which were compared with the ones obtained from the PF using the same L–J potential.[29] When the parameters of the L–J potential were adjusted to be so small that the atoms are nearly ideal gaseous atoms, the MD results are in very good agreement with the ones resulted from the PF of ideal gas obtained analytically, showing that the MD simulations are an excellent way for testing the PF. When the same MD procedure was performed on Ar atoms with L–J interaction potential, the internal energy and the expansion work at 200–300 K differ by about 20%–30% from the ones resulted from the PF obtained by the method of Hainam Do et al.[21,30]

In this paper, we proposed a more rapid and accurate method to calculate the PF of canonical ensembles and applied it to systems containing up to 1000 Ar atoms in either liquid or dense gaseous states. The obtained internal energies and isothermal expansion works (or free energy) are in a good agreement with those from MD simulations. Lastly, we illustrated that the method works easily for macroscopic or even infinite systems.

2. Problems and methods

For a canonical ensemble composed of systems at temperature T of volume V containing N indistinguishable particles of mass m with their coordinates and momenta denoted by and , respectively, the PF reads

(1)
where h is the Planck constant, and is the potential energy. Nearly all the methods for calculating Z(N,V,T) always integrate the momentum part first, obtaining
(2)
and then solve the so called configurational integral
(3)

Although departure of the configuration integral decreases the number of the integral variables in Eq. (1) by a half, we consider that it is this departure that leads to the difficulties existing in calculation of the PFs, because, for general potential function , it is too difficult to solve the 3N-fold integral neither by the analytical method nor via numerical calculation if the number of particles goes up to hundreds.

Different from the previous methods, we do not make the departure, but instead, write the integral (1) as

(4)
where the state density at total energy can be obtained easily by MD simulations. It should be noted that this state density is not the one of the potential energy concerned merely with the spatial configuration in the method of Hainam Do et al. (MHD).[21] According to thermodynamics, an isolated system in equilibrium state has a definite total energy (internal energy) and a certain temperature. Thus, for an equilibrium system relaxing around a total energy with a small fluctuation , the fluctuation of temperature, , should be small, and according to Virial theorem,[31] the fluctuation of the total momentum, , should also be small. That is, the total momentum frequently takes values within , where is the average of the total momentum , and the phase volume of the system can be written as
(5)
where C is the coefficient for the volume integral in the 3N-dimension momentum space and equal to . As for the integral in real space, , if the particles are rigid balls of volume v without interaction, then the coordinate of a ball’s center, , can take any value within the boundary of the system as long as there is no overlap between this ball and others (or the boundary), so the possible spatial volume for any ball to move in is (VNv) and ; if the particles are ‘atoms’ with interaction potential among them, then the coordinate of an atom’s center, , can also take any value within the boundary as long as the corresponding potential is allowed by the total energy . For given , the possible spatial volume for atom i to move in can be obtained by Monte Carlo (MC) simulation and (see below for details). Thus the state density is determined by
(6)

All the quantities in Eq. (6) can be easily obtained by MD and MC simulations. Specifically, every particle of the system is assigned a certain velocity initially and then is allowed to relax freely for hundreds of picoseconds to produce , , , and the potential range as functions of . For systems composed of up to 1000 Ar atoms confined in a cubic box, described by L–J interaction potential[32] with and ε = 119.8 K, the MD simulations with an integral step of 1 fs need only to last about 400 ps to produce the quantities, and fluctuations of the total momentum, the total energy, and the total potential are indeed small (as shown in Fig. 1) for 500 and 864 Ar atoms in a density of or , which are in agreement with our above analysis, although in principle the kinetic energy can completely convert into the potential energy. In consideration of the fluctuation, all the sampled data such as shown in Fig. 1 were fitted by smooth functions of to produce , , , and , which were used in Eq. (6) to determine . For obtaining Q, one thousand configurations have been sampled and stored during the above MD simulations with given , and for each one of the configurations, an atom selected arbitrarily was randomly positioned (shooting) within the cubic box for ten thousands times ( ) while the coordinates of other atoms remained unchanged; and for each random shooting, if was valid, then the allowed number K increased by 1, and finally we obtained the possible space volume for the atom , and . In consideration of the fluctuation due to different configurations, we took the averaged value in Eq. (6) and obtained the state density, as shown in Fig. 2. Finally, the data were fitted to functions of (solid curves in Fig. 2) to be used to calculate the PFs, which produce the internal energy, the entropy, the free energy, and so on.

Fig. 1. (color online) The variance range of the total momentum ( , ), the potential ( , ), , in arb. units as functions of for 500 Ar atoms in the density of (a) or (b) , and for 864 Ar atoms in the density of (c) or (d) . Here the total potential is shifted and is amplified for clear display.
Fig. 2. (color online) The calculated state density (dots) of 500, 864, and 1000 Ar atoms in a density of (gaseous state, denoted by G) or (liquid state, denoted by L) and the fitted functions (solid curves). Note that the independent variable for G1000 and L864 is instead of .

In order to test the accuracy of the PFs, the same L–J potential was applied in MD simulations of the system contacted with a heat reservoir at temperature T to produce the internal energy and isothermal expansion work at temperature T to compare with the results of the PFs. To obtain the internal energy, all atoms of the system were assigned to velocities of Maxwell’s distribution at the temperature T every 100 fs in the early period of 1 ps of the MD simulation with time step of 1 fs, and then the system was allowed to evolve for 400 ps to produce the mean value of the internal energy, during which ten atoms randomly selected every 0.1 ps were assigned to velocities of the Maxwell’s distribution to simulate effects of the heat reservoir.[2529] For obtaining the expansion work from the MD simulations, similar MD simulations were performed for different volumes of the system. Specifically, one side length of the cubic box was enlarged by a step of 0.1 Å, until the length increases by 2 Å, and for each step, the MD simulation lasted 400 ps to produce the pressure F calculated by[32]

(7)
where is the force felt by atom i located at and represents the ensemble average. The isothermal expansion work was calculated by , where is the increment of volumes in every step.

The internal energy and the expansion work at different temperature T from MD simulations for the systems composed of 500, 864, 1000 Ar atoms in a density of (gaseous state) or (liquid state) are shown in Fig. 3, where the results from the PFs of our method are also presented. The comparisons show that the differences between the MD and PFs in both the internal energy and the expansion work are no more than 3% for lower temperature, and smaller than 1% for high temperature. It is notable that the gas density of employed in our calculation is about three hundred times of the atmospheric density ( ) under standard conditions and the concerned pressure reaches up to nine hundreds times of one atmospheric pressure, while the density of corresponds to a liquid state and the pressure concerned in our calculation is as high as Pa, which is nearly ten thousands times of one atmospheric pressure.

Fig. 3. (color online) (a) The internal energy and (b) the expansion work at different temperature T from MD simulations (dot) and our method (solid line) for the systems composed of 500, 864, 1000 Ar atoms in a density of (gaseous state, denoted by G) or (liquid state, denoted by L). The internal energy for the liquid state was shifted by 60 eV for clear displaying.

For comparison, we also calculated the PFs of a system composed of 500 Ar atoms in a density of by MHD to produce the internal energy and the expansion work at different temperatures, which are presented in Table 1, Table 2, and Fig. 4 to be compared with the results of the MD. The relative deviation in both the internal energy and the expansion work is obviously larger than the one from our method, especially at lower temperatures (200–300 K). As an example, the internal energy and the expansion work at 200 K from the MHD are 2.6 eV and , respectively, while the results of the MD are 3.7 eV and , resulting in relative deviations as large as 30% and 20%, respectively, which are about ten times larger than the ones (∼3%) of our method. It should be stated that the accuracy of the MHD depends on the amount of the atomic configurations sampled in the calculations using the MHD, and 30000 configurations, which was suggested in Ref. [21], were sampled in each step to ensure that further increasing the number of configurations does not change the results significantly.[30] As for the computing speed, the MHD is about 10 times slower than our method, that is why we did not apply the MHD to calculate the PFs of larger systems.

Table 1.

The internal energy (in eV) at different temperature T (in K) from MD simulations, our method, and MHD for the system composed of 500 Ar atoms in a density of .

.
Table 2.

The expansion work (in ) at different temperature T (in K) from MD simulations, our method, and MHD for the system composed of 500 Ar atoms in a density of .

.
Fig. 4. (color online) (a) The internal energy and (b) the expansion work at different temperature T from MD simulations (dot), our method (solid line), and MHD (dash line) for the systems composed of 500 Ar atoms in a density of . The relative deviations of MHD (red dot) and our method (black dot) are shown in the inset.

It should be noted that the state density increases with the total energy E by , while the Boltzmann factor decreases exponentially with E for given T, resulting in a sharp distribution of the total energy ( ) around the most probable energy , corresponding to the temperature T. That is, the state density at E distant from by has little contribution to the PF for the given temperature T. So, for studying a system at given temperature via calculating the PF, we only need to calculate the state density around , which can be easily implemented by our method to further save the computation task. This makes our method much faster than MHD, which has to calculate the state density of the potential energy ranged from the highest to the lowest. Thus, our method can easily produce the PFs of much larger systems composed of millions of atoms that are large enough to ensure that the internal energy and the free energy increase linearly with the number of the atoms in the systems. As shown in Fig. 5, for the Ar systems, the energy ε and the free energy f of a single atom are indeed constants if the systems contain more than 500 atoms. That is, our method is applicable to macroscopic systems to produce the internal energy and the free energy by and .

Fig. 5. (color online) (a) The energy ε and (b) the free energy f per atom for systems composed of 500, 680, 864, and 1000 Ar atoms in density of for different temperatures.
3. Summary

Recognizing the flaw of departing the configurational integral from the PFs integral, we start from calculation of the state density of the total energy rather than the total potential energy to calculate the PFs, showing that it is much more accurate and efficient than the previous methods and may be applicable to macroscopic systems. Obviously, our method would find its vast application areas immediately.

Reference
[1] Hansen K 2013 Statistical Physics of Nanoparticles in the Gas Phase Dordrecht Springer-Verlag 1 25
[2] Hendriks E Walsh J van Bergen A 1997 Journal of Statistical Physics 87 1287
[3] Wang Y K Wei D Q Gu R X Fan H M Ulmschneider J 2013 Canadian Journal of Chemistry 91 769
[4] Morriss Andrews A Shea J E 2015 Annu. Rev. Chem. 66 643
[5] Alexander V Y 2011 Theory of Phase Transition in Polypeptides and Proteins Berlin Heidelberg Springer-Verlag 1 6
[6] Do H Wheatley R J 2013 The Journal of Chemical Theory and Computation 9 165
[7] Hale B Kiefer J 1975 Journal of Statistical Physics 12 437
[8] Mullin J W 2001 Crystallization 4 Oxford Butterworth-Heinemann 135 179
[9] Busch R Schroers J Wang W H 2007 MRS Bulletin 32 620
[10] Zwanzig R W 1954 The Journal of Chemical Physics 22 1420
[11] Henderson D Barker J A 1970 Phys. Rev. A 1 1266
[12] Chipot C Pohorille A 2007 Free Energy Calculations Berlin Heidelberg Springer-Verlag 37 50
[13] Ferrenberg A M Swendsen R H 1988 Phys. Rev. Lett. 61 2635
[14] Wang J S Tay T K Swendsen R H 1999 Phys. Rev. Lett. 82 476
[15] Wang F Landau D P 2001 Phys. Rev. Lett. 86 2050
[16] Ying W L Wust T Landau D P 2011 Computer Physics Communications 182 1896
[17] Caparica A A Cunha-Netto A G 2012 Phys. Rev. E 85 046702
[18] Komura Y Okabe Y 2012 Phys. Rev. E 85 010102
[19] Zhou C Bhatt R N 2005 Phys. Rev. E 72 025701
[20] Caparica A A 2014 Phys. Rev. E 89 043301
[21] Do H Hirst J D Wheatley R J 2011 The Journal of Chemical Physics 135 174105
[22] Allen M P Swetnam A D 2012 Physics Procedia 34 6
[23] Gai L Maerzke K A Cummings P T McCabe C 2012 The Journal of Chemical Physics 137 144901
[24] Aleksandrov T Desgranges C Delhommelle J 2012 Molecular Simulation 38 1265
[25] Gao J Lin Z Z Ning X J 2007 The Journal of Chemical Physics 126 174309
[26] Ye X X Ming C Hu Y C Ning X J 2009 The Journal of Chemical Physics 130 164711
[27] Han X J Wang Y Lin Z Z Zhang W Zhuang J Ning X J 2010 The Journal of Chemical Physics 132 064103
[28] Peng K Ming C Ye X X Zhang W X Zhaung J Ning X J 2010 Acta Phys. Sin. 59 7245 in Chinese
[29] Ming C Lin Z Z Zhuang J Ning X J 2012 Appl. Phys. Lett. 100 063119
[30] Li J T Gong L C Ning B Y Zhuang J Ning X J 2017 Submited to Science China
[31] Greiner W Neise L Stocker H 1995 Thermodynaics and Statistical Mechanics New York Springer-Verlag 194
[32] Allen M P Tildesley D J 1989 Computer Simulation of Liquid Oxford Clarendon Press 46 47